import sys

f = open(sys.argv[1])
for line in f:
    line = line.strip()
    parts = line.split()
    word_ids = parts[1].split(";")
    for word_id in word_ids:
        word_pr = word_id.split(":")
        sql = "insert into user_keyword(id,word_id,probability) values(%s,%s,%s);" % (parts[0],word_pr[0],word_pr[1])
        print sql
    
